package com.whu.zqm.dao;

import com.whu.zqm.domain.Products;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.whu.zqm.domain.prosup;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zqm
 * @since 2022-10-28
 */
@Mapper
public interface ProductsDao extends BaseMapper<Products> {

    @Select("select * from products")
    @Results({
            @Result(id = true,property = "id",column = "id"),
            @Result(property = "name",column = "name"),
            @Result(property = "num",column = "num"),
            @Result(property = "price",column = "price"),
            @Result(property = "suppliers",column = "id", many = @Many(select = "com.whu.zqm.dao.PsDao.getSuppliersByPid"))
    })
    List<prosup>findAllProsup();

}
